import { resolve } from 'path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    resolve: {
        alias: [
            {
                find: /\/@\//, // /@/xxxx => src/xxxx
                replacement: resolve(__dirname, 'src') + '/',
            },
            {
                find: /\/#\//, // /#/xxxx => types/xxxx
                replacement: resolve(__dirname, 'types') + '/',
            },
            {
                find: /@\//, // @/xxxx => src/xxxx
                replacement: resolve(__dirname, 'src') + '/',
            },
            {
                find: /#\//, // #/xxxx => types/xxxx
                replacement: resolve(__dirname, 'types') + '/',
            },
        ],
    },
    server: {
        host: '0.0.0.0',
        port: 80,
        open: true,
    },
    plugins: [vue()],
    // build: {
    //     outDir: '../',
    // },
});
